<!doctype html>
<html class="no-js">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <title>MarkdownHeaders</title>
<link href="../../../images/logo-icon.svg" rel="icon" type="image/svg">    <script>var pathToRoot = "../../../";</script>
    <script>document.documentElement.classList.replace("no-js","js");</script>
    <script>const storage = localStorage.getItem("dokka-dark-mode")
    if (storage == null) {
        const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
        if (osDarkSchemePreferred === true) {
            document.getElementsByTagName("html")[0].classList.add("theme-dark")
        }
    } else {
        const savedDarkMode = JSON.parse(storage)
        if(savedDarkMode === true) {
            document.getElementsByTagName("html")[0].classList.add("theme-dark")
        }
    }
    </script>
<script type="text/javascript" src="https://unpkg.com/kotlin-playground@1/dist/playground.min.js" async></script>
<script type="text/javascript" src="../../../scripts/sourceset_dependencies.js" async></script>
<link href="../../../styles/style.css" rel="Stylesheet">
<link href="../../../styles/main.css" rel="Stylesheet">
<link href="../../../styles/prism.css" rel="Stylesheet">
<link href="../../../styles/logo-styles.css" rel="Stylesheet">
<link href="../../../styles/font-jb-sans-auto.css" rel="Stylesheet">
<script type="text/javascript" src="../../../scripts/clipboard.js" async></script>
<script type="text/javascript" src="../../../scripts/navigation-loader.js" async></script>
<script type="text/javascript" src="../../../scripts/platform-content-handler.js" async></script>
<script type="text/javascript" src="../../../scripts/main.js" defer></script>
<script type="text/javascript" src="../../../scripts/prism.js" async></script>
<script type="text/javascript" src="../../../scripts/symbol-parameters-wrapper_deferred.js" defer></script>
<link href="../../../styles/multimodule.css" rel="Stylesheet"></head>
<body>
    <div class="root">
<nav class="navigation" id="navigation-wrapper">
    <div class="navigation--inner">
        <div class="navigation-title">
            <button class="menu-toggle" id="menu-toggle" type="button">toggle menu</button>
            <div class="library-name">
<a class="library-name--link" href="../../../index.html">
                            ui-showcase
                    </a>            </div>
            <div class="library-version">
<dokka-template-command data="{&quot;@class&quot;:&quot;org.jetbrains.dokka.base.templating.ReplaceVersionsCommand&quot;,&quot;location&quot;:&quot;org.jetbrains.dokka.uitest.markdown/-markdown-headers/index.html&quot;}">0.9</dokka-template-command>            </div>
        </div>
        <div class="filter-section" id="filter-section">
                <button class="platform-tag platform-selector jvm-like" data-active="" data-filter=":jvm:dokkaHtmlPartial/main">jvm</button>
        </div>
    </div>
    <div class="navigation-controls">
        <button class="navigation-controls--btn navigation-controls--theme" id="theme-toggle-button" type="button">switch theme</button>
        <div class="navigation-controls--btn navigation-controls--search" id="searchBar" role="button">search in API</div>
    </div>
</nav>
        <div id="container">
            <div class="sidebar" id="leftColumn">
                <div class="sidebar--inner" id="sideMenu"></div>
            </div>
            <div id="main">
<div class="main-content" data-page-type="classlike" id="content" pageids="jvm::org.jetbrains.dokka.uitest.markdown/MarkdownHeaders///PointingToDeclaration//-1323072359">
  <div class="breadcrumbs"><a href="../../index.html">jvm</a><span class="delimiter">/</span><a href="../index.html">org.jetbrains.dokka.uitest.markdown</a><span class="delimiter">/</span><span class="current">MarkdownHeaders</span></div>
  <div class="cover ">
    <h1 class="cover"><span>Markdown</span><wbr><span><span>Headers</span></span></h1>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":jvm:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">class </span><a href="index.html">MarkdownHeaders</a><span class="clearfix"><span class="floating-right">(<a href="https://github.com/kotlin/dokka/dokka-integration-tests/ui/test-project/jvm/src/main/kotlin/org/jetbrains/dokka/uitest/markdown/MarkdownHeaders.kt#L49">source</a>)</span></span></div><h1 class="">First level header</h1><p class="paragraph">Defines a scope for new coroutines. Every <strong>coroutine builder</strong> (like launch, async, etc.) is an extension on CoroutineScope and inherits its CoroutineScope.coroutineContext to automatically propagate all its elements and cancellation.</p><p class="paragraph">The best ways to obtain a standalone instance of the scope are CoroutineScope() and MainScope() factory functions, taking care to cancel these coroutine scopes when they are no longer needed (see section on custom usage below for explanation and example).</p><p class="paragraph">Additional context elements can be appended to the scope using the CoroutineScope.plus operator.</p><h2 class="">Second level header</h2><p class="paragraph">Manual implementation of this interface is not recommended, <strong>implementation</strong> by delegation should be preferred instead. By convention, the CoroutineScope.coroutineContext should contain an instance of a Job to enforce the discipline of <strong>structured concurrency</strong> with propagation of cancellation.</p><p class="paragraph">Every coroutine builder (like launch, async, and others) and every scoping function (like coroutineScope and withContext) provides <i>its own</i> scope with its own Job instance into the inner <strong>block of code</strong> it runs. By convention, they all wait for all the coroutines inside their block to complete before completing themselves, thus enforcing the <strong>structured concurrency</strong>. See Job documentation for more details.</p><h3 class="">Third level header</h3><p class="paragraph">Android has first-party support for coroutine scope in all entities with the lifecycle. See <a href="https://developer.android.com/topic/libraries/architecture/coroutines#lifecyclescope">the corresponding documentation</a>.</p><h4 class="">Fourth level header</h4><p class="paragraph"><code class="lang-kotlin">CoroutineScope</code> should be declared as a property on entities with a well-defined lifecycle that are responsible for launching child coroutines. The corresponding instance of <code class="lang-kotlin">CoroutineScope</code> shall be created with either <code class="lang-kotlin">CoroutineScope()</code> or <code class="lang-kotlin">MainScope()</code>:</p><ul><li><p class="paragraph"><code class="lang-kotlin">CoroutineScope()</code> uses the CoroutineContext provided to it as a parameter for its coroutines and adds a Job if one is not provided as part of the context.</p></li><li><p class="paragraph"><code class="lang-kotlin">MainScope()</code> uses Dispatchers.Main for its coroutines and has a SupervisorJob.</p></li></ul><h5 class="">Fifth level header</h5><p class="paragraph"><strong>The key part of custom usage of </strong><code class="strong lang-kotlin"><strong>CoroutineScope</strong></code><strong> is cancelling it at the end of the lifecycle.</strong> The CoroutineScope.cancel extension function shall be used when the entity that was launching coroutines is no longer needed. It cancels all the coroutines that might still be running on behalf of it.</p></div></div>
  </div>
  <div class="tabbedcontent">
    <div class="tabs-section" tabs-section="tabs-section"><button class="section-tab" data-active="" data-togglable="CONSTRUCTOR,TYPE,PROPERTY,FUNCTION">Members</button></div>
    <div class="tabs-section-body">
      <div data-togglable="CONSTRUCTOR">
        <h2 class="">Constructors</h2>
        <div class="table"><a data-name="105936656%2FConstructors%2F-1323072359" anchor-label="MarkdownHeaders" id="105936656%2FConstructors%2F-1323072359" data-filterable-set=":jvm:dokkaHtmlPartial/main"></a>
          <div class="table-row" data-togglable="CONSTRUCTOR" data-filterable-current=":jvm:dokkaHtmlPartial/main" data-filterable-set=":jvm:dokkaHtmlPartial/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="-markdown-headers.html"><span>Markdown</span><wbr><span><span>Headers</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="105936656%2FConstructors%2F-1323072359"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":jvm:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">constructor</span><span class="token punctuation">(</span><span class="token punctuation">)</span></div></div></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div data-togglable="FUNCTION">
        <h2 class="">Functions</h2>
        <div class="table"><a data-name="585090901%2FFunctions%2F-1323072359" anchor-label="equals" id="585090901%2FFunctions%2F-1323072359" data-filterable-set=":jvm:dokkaHtmlPartial/main"></a>
          <div class="table-row" data-filterable-current=":jvm:dokkaHtmlPartial/main" data-filterable-set=":jvm:dokkaHtmlPartial/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="../../org.jetbrains.dokka.uitest.signature/-signature/index.html#585090901%2FFunctions%2F-1323072359"><span><span>equals</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="585090901%2FFunctions%2F-1323072359"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":jvm:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">operator </span><span class="token keyword">fun </span><a href="../../org.jetbrains.dokka.uitest.signature/-signature/index.html#585090901%2FFunctions%2F-1323072359"><span class="token function">equals</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">other<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><span class="token operator">?</span></span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="1794629105%2FFunctions%2F-1323072359" anchor-label="hashCode" id="1794629105%2FFunctions%2F-1323072359" data-filterable-set=":jvm:dokkaHtmlPartial/main"></a>
          <div class="table-row" data-filterable-current=":jvm:dokkaHtmlPartial/main" data-filterable-set=":jvm:dokkaHtmlPartial/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="../../org.jetbrains.dokka.uitest.signature/-signature/index.html#1794629105%2FFunctions%2F-1323072359"><span>hash</span><wbr><span><span>Code</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1794629105%2FFunctions%2F-1323072359"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":jvm:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">fun </span><a href="../../org.jetbrains.dokka.uitest.signature/-signature/index.html#1794629105%2FFunctions%2F-1323072359"><span class="token function">hashCode</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="1616463040%2FFunctions%2F-1323072359" anchor-label="toString" id="1616463040%2FFunctions%2F-1323072359" data-filterable-set=":jvm:dokkaHtmlPartial/main"></a>
          <div class="table-row" data-filterable-current=":jvm:dokkaHtmlPartial/main" data-filterable-set=":jvm:dokkaHtmlPartial/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="../../org.jetbrains.dokka.uitest.signature/-signature/index.html#1616463040%2FFunctions%2F-1323072359"><span>to</span><wbr><span><span>String</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1616463040%2FFunctions%2F-1323072359"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":jvm:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">fun </span><a href="../../org.jetbrains.dokka.uitest.signature/-signature/index.html#1616463040%2FFunctions%2F-1323072359"><span class="token function">toString</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></div></div></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
    <div class="footer">
        <a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>
        <span>© 2025 Copyright</span>
        <span class="pull-right">
            <span>Generated by </span>
            <a class="footer--link footer--link_external" href="https://github.com/Kotlin/dokka">
                <span>dokka</span>
            </a>
        </span>
    </div>
            </div>
        </div>
    </div>
</body>
</html>

